package com.zfl.thread.day05;

import java.util.concurrent.atomic.AtomicStampedReference;

public class AtomicStampedReferenceDemo01 {
    public static void main(String[] args) {
        AtomicStampedReference<Integer> atomicStampedReference = new AtomicStampedReference<>(10,1);
        System.out.println(atomicStampedReference.getStamp());
        System.out.println(atomicStampedReference.getReference());
        System.out.println(atomicStampedReference.compareAndSet(10,20,1,2));
        System.out.println(atomicStampedReference.getStamp()+" "+atomicStampedReference.getReference());
    }
}
